<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.polynomials.base.Polynomial&rdquo;</title>
        </head>
        <body><h1 class="class">Class s.p.b.Polynomial(Basic):</h1><span id="part">Part of <a href="sympy.polynomials.base.html">sympy.polynomials.base</a></span><div class="toplevel"><div><p>Unified representation of all kinds of polynomials.</p>
<h1 class="heading">Usage:</h1>
  <p>Most of the time, the Polynomial instances are created of a SymPy 
  expression, which is a polynomial.</p>
  <p>Optionally, the user can give a 'var' argument containing the list of 
  variables (in order), so that he can view 2*x + x*y as a polynomial in x 
  only, for example. If not given, the occuring symbols are extracted 
  automatically and sorted alphabetically.</p>
  <p>The (optional) argument 'order' defines the monomial order, which is 
  of importance to division algorithms and Groebner bases and defaults to 
  'grevlex', that is graded reverse lexicographic ordering. Other options 
  are: 'lex' - lexicographic order 'grlex' - graded lexicographic order 
  '1-el' - first elimination order</p>
  <p>Alternatively, a Polynomial can be instantiated by giving its 
  coefficients and exponents in nested tuples, alone or in addidition to 
  the sympy_expr. Here, no consistency checks are done as this mode is 
  intended for internal use mostly.</p>
  <p>The built Polynomial instances support arithmetic, like addition and 
  multiplication, but fall back to the underlying SymPy expression, when a 
  non-Polynomial is encountered.</p>
  <p>The SymPy expression of a Polynomial f can be accessed through 
  f.sympy_expr. The coefficients and exponents are held in f.coeffs , f.var
  and f.order hold the respective arguments.</p>
<h1 class="heading">Notes:</h1>
  <p>Computes the coefficients with the exponents in sparse representation 
  for faster arithmetic and leading terms etc. Tries to be compatible with 
  other SymPy expressions, for example, by forwarding most attributes like 
  assumptions to the underlying SymPy expression.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(x + 1)
<span class="py-prompt">&gt;&gt;&gt; </span>f.sympy_expr
<span class="py-output">1 + x</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f.coeffs
<span class="py-output">((1, 1), (1, 0))</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f.var
<span class="py-output">[x]</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f.order
<span class="py-output">'grevlex'</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">1 + x</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f
<span class="py-output">Polynomial(1 + x, ((1, 1), (1, 0)), [x], 'grevlex')</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>g = Polynomial(y**2 - x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>s = f + g
<span class="py-prompt">&gt;&gt;&gt; </span>s.var == [x, y]
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>bool(s == y**2 - x*y + x + 1)
<span class="py-output">True</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>h = Polynomial(g.sympy_expr, var=y)
<span class="py-prompt">&gt;&gt;&gt; </span>g.coeffs
<span class="py-output">((-1, 1, 1), (1, 0, 2))</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>h.coeffs
<span class="py-output">((1, 2), (-x, 1))</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.sympy2coefficients.html">sympy2coefficients</a>,
  <a 
  href="sympy.polynomials.base.coefficients2sympy.html">coefficients2sympy</a>.</p>
</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__new__">__new__</a></td><td><span class="undocumented">Undocumented</span></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__getattribute__">__getattribute__</a></td><td><div><p>Redirect most attributes to the underlying SymPy expression.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__str__">__str__</a></td><td><div><p>Return only the SymPy expression to be human-readable.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__repr__">__repr__</a></td><td><div><p>Returns a string that could be used to reconstruct this object.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__eq__">__eq__</a></td><td><div><p>Equality is restricted to equality of SymPy expression.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__ne__">__ne__</a></td><td><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__eq__.html">__eq__</a>.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__pos__">__pos__</a></td><td><div><p>Just returns the Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__neg__">__neg__</a></td><td><div><p>Returns the Polynomial multiplied by -1.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__add__">__add__</a></td><td><div><p>Overwrites the + operator.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__radd__">__radd__</a></td><td><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__sub__">__sub__</a></td><td><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>,  <a 
href="sympy.polynomials.base.Polynomial.__neg__.html">__neg__</a>.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__rsub__">__rsub__</a></td><td><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>, <a 
href="sympy.polynomials.base.Polynomial.__neg__.html">__neg__</a></p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__mul__">__mul__</a></td><td><div><p>Overwrites the * operator.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__rmul__">__rmul__</a></td><td><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__mul__.html">__mul__</a>.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__pow__">__pow__</a></td><td><div><p>Overwrites the ** operator.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.__call__">__call__</a></td><td><div><p>Evaluate the polynomial function at a specific point.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.as_integer">as_integer</a></td><td><div><p>Return the polynomial with integer coefficients.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.as_monic">as_monic</a></td><td><div><p>Return the polynomial with leading coefficient 1.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.as_primitive">as_primitive</a></td><td><div><p>Return the content and a primitive Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.content">content</a></td><td><div><p>Return the content of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.diff">diff</a></td><td><div><p>Derivative of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.integrate">integrate</a></td><td><div><p>Primitive function of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.coeff">coeff</a></td><td><div><p>Returns the coefficient at x**n</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.leading_coeff">leading_coeff</a></td><td><div><p>Return the leading coefficient of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.leading_term">leading_term</a></td><td><div><p>Return the leading term of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.nth_coeff">nth_coeff</a></td><td><div><p>Return a specific coefficient of a Polynomial.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.degree">degree</a></td><td><span class="undocumented">Undocumented</span></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.polynomials.base.Polynomial.as_basic">as_basic</a></td><td><span class="undocumented">Undocumented</span></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__new__">__new__(cls, sympy_expr=None, coeffs=None, var=None, order=None, **assumptions):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__getattribute__">__getattribute__(self, name):</a></div>
            <div class="functionBody"><div><p>Redirect most attributes to the underlying SymPy expression.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__str__">__str__(self):</a></div>
            <div class="functionBody"><div><p>Return only the SymPy expression to be human-readable.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__repr__">__repr__(self):</a></div>
            <div class="functionBody"><div><p>Returns a string that could be used to reconstruct this object.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__eq__">__eq__(self, other):</a></div>
            <div class="functionBody"><div><p>Equality is restricted to equality of SymPy expression.</p>
<p>This overwrites the == operator. Other attributes such as variables or 
monomial order are not compared.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__ne__">__ne__(self, other):</a></div>
            <div class="functionBody"><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__eq__.html">__eq__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__pos__">__pos__(self):</a></div>
            <div class="functionBody"><div><p>Just returns the Polynomial.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__neg__">__neg__(self):</a></div>
            <div class="functionBody"><div><p>Returns the Polynomial multiplied by -1.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__add__">__add__(self, other):</a></div>
            <div class="functionBody"><div><p>Overwrites the + operator.</p>
<p>Implements an addition algorithm for instances of Polynomial with 
matching variables, using the coefficients and exponents, but falls back to
the SymPy expressions otherwise. It even returns a non-Polynomial object 
when encountering one.</p>
<p>Also see <a 
href="sympy.polynomials.base.Polynomial.html">Polynomial</a>, <a 
href="sympy.polynomials.base.Polynomial.__mul__.html">__mul__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__radd__">__radd__(self, other):</a></div>
            <div class="functionBody"><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__sub__">__sub__(self, other):</a></div>
            <div class="functionBody"><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>,  <a 
href="sympy.polynomials.base.Polynomial.__neg__.html">__neg__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__rsub__">__rsub__(self, other):</a></div>
            <div class="functionBody"><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>, <a 
href="sympy.polynomials.base.Polynomial.__neg__.html">__neg__</a></p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__mul__">__mul__(self, other):</a></div>
            <div class="functionBody"><div><p>Overwrites the * operator.</p>
<p>Implements a multiplication algorithm for instances of Polynomial with 
matching variables, using the coefficients and exponents, but falls back to
the SymPy expressions otherwise. It even returns a non-Polynomial object 
when encountering one.</p>
<p>Also see <a 
href="sympy.polynomials.base.Polynomial.html">Polynomial</a>, <a 
href="sympy.polynomials.base.Polynomial.__add__.html">__add__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__rmul__">__rmul__(self, other):</a></div>
            <div class="functionBody"><div><p>Also see <a 
href="sympy.polynomials.base.Polynomial.__mul__.html">__mul__</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__pow__">__pow__(self, other):</a></div>
            <div class="functionBody"><div><p>Overwrites the ** operator.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.__call__">__call__(self, *point):</a></div>
            <div class="functionBody"><div><p>Evaluate the polynomial function at a specific point.</p>
<h1 class="heading">Usage:</h1>
  <p>Give an arbitrary argument for each variable and get the SymPy 
  expression with the variables substituted.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(2*x - y)
<span class="py-prompt">&gt;&gt;&gt; </span>f(1, 7)
<span class="py-output">-5</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f(3*x, x)
<span class="py-output">5*x</span></pre>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.as_integer">as_integer(self):</a></div>
            <div class="functionBody"><div><p>Return the polynomial with integer coefficients.</p>
<h1 class="heading">Usage:</h1>
  <p>Starting from an instance of Polynomial with only rational 
  coefficients, this function multiplies it with the common denominator. 
  The result is a tuple consisting of the factor applied to the 
  coefficients and a new instance of Polynomial in the integers.</p>
<h1 class="heading">Example:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(x/6 + y/4 + x*y/3)
<span class="py-prompt">&gt;&gt;&gt; </span>denominator, f = f.as_integer()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> denominator
<span class="py-output">12</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">2*x + 3*y + 4*x*y</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>denominator, f = f.as_integer()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> denominator
<span class="py-output">1</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">2*x + 3*y + 4*x*y</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.as_monic.html">as_monic</a>, <a 
  href="sympy.polynomials.base.Polynomial.as_primitive.html">as_primitive</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.as_monic">as_monic(self):</a></div>
            <div class="functionBody"><div><p>Return the polynomial with leading coefficient 1.</p>
<h1 class="heading">Usage:</h1>
  <p>Starting with any instance of Polynomial, this returns the former 
  leading coefficient and a new Polynomial which is monic.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(x/2 + y/4 + x*y/3)
<span class="py-prompt">&gt;&gt;&gt; </span>leadcoeff, f = f.as_monic()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> leadcoeff
<span class="py-output">1/3</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">(3/2)*x + (3/4)*y + x*y</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>leadcoeff, f = f.as_monic()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> leadcoeff
<span class="py-output">1</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">(3/2)*x + (3/4)*y + x*y</span></pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(y*x, var=x)
<span class="py-prompt">&gt;&gt;&gt; </span>leadcoeff, f = f.as_monic()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> leadcoeff
<span class="py-output">y</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">x</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.as_integer.html">as_integer</a>, 
  <a 
  href="sympy.polynomials.base.Polynomial.as_primitive.html">as_primitive</a>,
  <a 
  href="sympy.polynomials.base.Polynomial.leading_coeff.html">leading_coeff</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.as_primitive">as_primitive(self):</a></div>
            <div class="functionBody"><div><p>Return the content and a primitive Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>Starting with any instance of Polynomial, this returns the content, 
  that is, the greatest common divisor of the (integer-or-symbolic) 
  coefficients, and a new Polynomial which is primitive, that is, of 
  content 1. Only works for integer coefficients.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>content, f = f.as_primitive()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> content
<span class="py-output">2</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">3*x + 10*y + 2*x*y</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>content, f = f.as_primitive()
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> content
<span class="py-output">1</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f
<span class="py-output">3*x + 10*y + 2*x*y</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.as_integer.html">as_integer</a>, 
  <a href="sympy.polynomials.base.Polynomial.as_monic.html">as_monic</a>, 
  <a href="sympy.polynomials.base.Polynomial.content.html">content</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.content">content(self):</a></div>
            <div class="functionBody"><div><p>Return the content of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>Returns the content, that is, the positive greatest common divisor of 
  the (integer-or-symbolic) coefficients.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>f.content()
<span class="py-output">2</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(y**2*x**2 + y, var=x)
<span class="py-prompt">&gt;&gt;&gt; </span>f.content()
<span class="py-output">y</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.as_primitive.html">as_primitive</a>,
  <a 
  href="sympy.polynomials.base.Polynomial.leading_coeff.html">leading_coeff</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.diff">diff(self, variable):</a></div>
            <div class="functionBody"><div><p>Derivative of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>Returns a new instance of Polynomial which is the partial derivative 
  by the given variable.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y, z = symbols(<span class="py-string">'xyz'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>fx = f.diff(x)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> fx
<span class="py-output">6 + 4*y</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>fz = f.diff(z)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> fz
<span class="py-output">0</span></pre>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.integrate">integrate(self, variable):</a></div>
            <div class="functionBody"><div><p>Primitive function of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>Returns a new instance of Polynomial which is the primitive function 
  (antiderivative) of &quot;self&quot; with respect to the given 
  variable.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y, z = symbols(<span class="py-string">'xyz'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>fx = f.integrate(x)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> fx
<span class="py-output">20*x*y + 3*x**2 + 2*y*x**2</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>fz = f.integrate(z)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> fz
<span class="py-output">6*x*z + 20*y*z + 4*x*y*z</span></pre>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.coeff">coeff(self, x, n):</a></div>
            <div class="functionBody"><div><p>Returns the coefficient at x**n</p>
<p>Example: &gt;&gt;&gt; a, x = symbols(&quot;ax&quot;) &gt;&gt;&gt; f = 
(a+1)*x + (a+2)*x**2 + a &gt;&gt;&gt; Polynomial(f).coeff(x, 2) 2 + a 
&gt;&gt;&gt; Polynomial(f).coeff(a, 1) 1 + x + x**2</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.leading_coeff">leading_coeff(self):</a></div>
            <div class="functionBody"><div><p>Return the leading coefficient of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>This gives the coefficient, that is, non-symbolic part, of the leading
  term, according to the monomial order, or simply highest degree, in the 
  univariate case.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>f.leading_coeff()
<span class="py-output">4</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.as_monic.html">as_monic</a>, <a 
  href="sympy.polynomials.base.Polynomial.leading_term.html">leading_term</a>,
  <a 
  href="sympy.polynomials.base.Polynomial.nth_coeff.html">nth_coeff</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.leading_term">leading_term(self):</a></div>
            <div class="functionBody"><div><p>Return the leading term of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>The leading term, according to the monomial order, or simply highest 
  degree, in the univariate case.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">print</span> f.leading_term()
<span class="py-output">4*x*y</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.leading_coeff.html">leading_coeff</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.nth_coeff">nth_coeff(self, *exponent):</a></div>
            <div class="functionBody"><div><p>Return a specific coefficient of a Polynomial.</p>
<h1 class="heading">Usage:</h1>
  <p>This gives the coefficient, that is, non-symbolic part, of the term 
  with matching exponents, or 0, if it doesn't appear.</p>
<h1 class="heading">Examples:</h1>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>x, y = symbols(<span class="py-string">'xy'</span>)
<span class="py-prompt">&gt;&gt;&gt; </span>f = Polynomial(6*x + 20*y + 4*x*y)
<span class="py-prompt">&gt;&gt;&gt; </span>f.nth_coeff(1, 0)
<span class="py-output">6</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f.nth_coeff(1, 1)
<span class="py-output">4</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>f.nth_coeff(0, 0)
<span class="py-output">0</span></pre>
  <p>Also see <a 
  href="sympy.polynomials.base.Polynomial.leading_coeff.html">leading_coeff</a>.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.degree">degree(self):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.polynomials.base.Polynomial.as_basic">as_basic(self):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div></body>
        